import pygame
import random

class Sparkles (pygame.sprite.Sprite):
    def __init__ (self, x1,x2,y1,y2,time):
        pygame.sprite.Sprite.__init__(self)
        self.width = 2
        #self.height = 2
        self.x = random.randint(x1,x2)
        self.y = random.randint(y1,y2)
        #self.surface = pygame.Surface((self.width,self.height))
        #self.rect=pygame.Rect(self.x, self.y, self.width, self.height)
        #self.rect.center = (self.x, self.y)
        #self.Show = True
        #self.surface.fill ((210,210,210))
        self.time = time + float(random.randint(100, 600))
        self.grow = False
        self.color = (210,210,210)

    def update (self, screen):
        if self.grow:
            if self.width < 3:
                self.width = self.width + 1
            if self.width >= 6:
                self.grow = False
        else:
            if self.width > 0:
                self.width = self.width - 1
            if self.width <= 0:
                self.grow = True

        self.y = self.y - 1
        
        pygame.draw.circle(screen, self.color,
            (self.x, self.y), self.width, 0)

class SparklesMouse (pygame.sprite.Sprite):
    def __init__ (self, x1,y1,time):
        pygame.sprite.Sprite.__init__(self)
        self.width = 0
        self.x = x1
        self.y = y1
        self.time = time + 400

        self.grow = False
        self.color = (255,0,0)

    def update (self, screen):
        if self.grow:
            if self.width < 3:
                self.width = self.width + 1
            if self.width >= 6:
                self.grow = False
        else:
            if self.width > 0:
                self.width = self.width - 1
            if self.width <= 0:
                self.grow = True

        #self.y = self.y - 1
        
        pygame.draw.circle(screen, self.color,
            (self.x, self.y), self.width, 0)
